Add FreeBSD compatibility and FreeBSD services support#18
Add FreeBSD compatibility and FreeBSD services support#18Limych wants to merge 6 commits intoAndrewMarchukov:masterfrom
Conversation
|
nice work |
tracker-add-auto.sh
Outdated
| echo "URL for ${base_url}" | ||
| echo "Adding trackers for $torrent_name..." | ||
| for tracker in $(cat $trackerslist) ; do | ||
| echo -n "${tracker}..." |
There was a problem hiding this comment.
echo -n doesn't work on bin/sh, maybe printf '%s\n' can fix it
There was a problem hiding this comment.
Very strange. Are you sure this code doesn't work?
Test 1:
user:~$ sh
$ uname -sv
Linux #49-Ubuntu SMP Fri Feb 5 03:01:28 UTC 2021
$ echo -n "test..."
test...$
Test 2:
root@server:~ # sh
# uname -sv
FreeBSD FreeBSD 12.2-RELEASE-p3 7851f4a452d(HEAD) TRUENAS
# echo -n "test..."
test...#
tracker-add-auto.sh
Outdated
| dater="$(date "+%Y-%m-%d %H:%M")" | ||
|
|
||
| if [ ! -f "/tmp/TTAA.$id.lock" ]; then | ||
| if [ "$add_date_t" = "$dater" -o "$add_date_t" = "$dateo" ]; then |
There was a problem hiding this comment.
regress changes
should be if [[ "( "$(add_date_t)" == "$(dater)" || "$(add_date_t)" == "$(dateo)" )" ]]; then or something like that
There was a problem hiding this comment.
There is no built-in command [[ in sh. There is a command [, which has a slightly different syntax. I just translated the logic of the command [[ into the syntax of the command [.
What you wrote is exactly the condition that is specified.
tracker-add-auto.sh
Outdated
| ids="$(${trans} --list | grep -vE 'Seeding|Stopped|Finished|[[:space:]]100%[[:space:]]' | grep '^ ' | awk '{ print $1 }' | grep -vE 'ID')" | ||
| for id in $ids ; do | ||
| add_date="$(${trans} --torrent "$id" --info| grep '^ Date added: ' |cut -c 21-)" | ||
| if [ $(uname) = "FreeBSD" ]; then |
There was a problem hiding this comment.
"$(uname)" just in case, prevent word splitting
# Conflicts: # tracker-add-auto.sh
|
PR updated |
No description provided.